<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:s="http://jboss.org/schema/seam/taglib"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:a4j="http://richfaces.org/a4j"
  template="../WEB-INF/template/template_nobanner.xhtml">

  <ui:define name="page_title">#{msgs['jsf.Login']}</ui:define>
  <ui:define name="center_content">

    <div class="header__logo-only">
      <s:link view="/home.xhtml" propagation="none" id="home" tabindex="1">
        <img src="#{applicationConfiguration.webAssetsUrl}/logo.svg"
          alt="Zanata"/>
      </s:link>
    </div>

    <div class="g--centered">
      <div
        class="g__item #{applicationConfiguration.multiAuth ? 'l--constrain-medium l--constrain-small-m' : 'l--constrain-small'}">
        <div class="l--push-v-1">
          <a4j:outputPanel ajaxRendered="true" layout="block">
            <h:messages id="messages" globalOnly="true"
              styleClass="list--no-bullets"
              errorClass="message--danger l--push-bottom-half"
              infoClass="message--highlight l--push-bottom-half"
              warnClass="message--warning l--push-bottom-half"
              rendered="#{showGlobalMessages != 'false'}"/>
          </a4j:outputPanel>
          <div class="g">
            <ui:remove>
              <!--Internal, JAAS and Kerberos Login form-->
            </ui:remove>
            <s:div
              styleClass="l--push-top-half g__item #{applicationConfiguration.multiAuth ? 'w--1-2 w--1-m' : ''}"
              rendered="#{applicationConfiguration.internalAuth or applicationConfiguration.jaasAuth or applicationConfiguration.kerberosAuth}">
              <s:fragment rendered="#{applicationConfiguration.multiAuth}">
                <h2
                  class="gamma heading--sub">#{msgs['jsf.login.WithZanata.label']}</h2>
              </s:fragment>
              <s:fragment rendered="#{applicationConfiguration.kerberosAuth}">
                <p class="txt--meta">
                  <h:outputText escape="false"
                    value="#{msgs['jsf.auth.KerberosNotice.label']}">
                  </h:outputText>
                </p>
              </s:fragment>

              <h:form id="loginForm"
                styleClass="l--push-top-half l--pad-all-1 bg--pop-higher">
                <div class="l--clearfix">
                  <h:outputLabel for="username"
                    styleClass="l--float-left">#{msgs['jsf.Username']}</h:outputLabel>
                </div>
                <h:inputText id="username" value="#{loginAction.username}"
                  tabindex="2"/>

                <div class="l--push-top-half l--clearfix">
                  <h:outputLabel for="password"
                    styleClass="l--float-left">#{msgs['jsf.Password']}</h:outputLabel>
                  <span class="txt--meta l--float-right">
                    <s:link view="/account/password_reset_request.xhtml"
                      propagation="none" tabindex="4"
                      rendered="#{applicationConfiguration.internalAuth}">
                      #{msgs['jsf.ForgotYourPassword']}
                    </s:link>
                  </span>
                </div>
                <h:inputSecret id="password" value="#{loginAction.password}"
                  tabindex="3"/>

                <div class="l--push-top-1">
                  <h:commandButton id="loginButton"
                    action="#{loginAction.login}"
                    value="#{msgs['jsf.Login']}"
                    styleClass="button--primary button--full"/>

                  <s:fragment
                    rendered="#{applicationConfiguration.internalAuth}">
                    <div
                      class="txt--align-center txt--align-center-s l--push-top-half">
                      #{msgs['jsf.login.DontHaveAnAccount.label']} <s:link
                      view="/account/register.xhtml"
                      value="#{msgs['jsf.SignUp']}"/>
                    </div>
                  </s:fragment>
                  <s:fragment
                    rendered="#{not applicationConfiguration.internalAuth and not empty applicationConfiguration.registerPath}">
                    <h:outputLink value="#{applicationConfiguration.registerPath}">
                      <h:outputText value="#{msgs['jsf.Signup']}"/>
                    </h:outputLink>
                  </s:fragment>
                </div>
              </h:form>
            </s:div>
            <ui:remove>
              <!-- OpenId Login form-->
            </ui:remove>
            <s:div
              styleClass="l--push-top-half g__item #{applicationConfiguration.multiAuth ? 'w--1-2 w--1-m' : ''}"
              rendered="#{applicationConfiguration.openIdAuth}">
              <h:form>
                <s:fragment rendered="#{applicationConfiguration.multiAuth}">
                  <h2
                    class="gamma heading--sub">#{msgs['jsf.login.OrLoginUsing.label']}</h2>
                </s:fragment>
                <ul class="list--no-bullets">
                  <li class="l--push-top-half">
                    <h:commandLink action="#{loginAction.openIdLogin('Fedora')}"
                      styleClass="button--full button--fedora" value="Fedora"/>
                  </li>
                  <li class="l--push-top-half">
                    <h:commandLink action="#{loginAction.openIdLogin('Google')}"
                      styleClass="button--full button--google" value="Google"/>
                  </li>
                  <li class="l--push-top-half">
                    <h:commandLink action="#{loginAction.openIdLogin('Yahoo')}"
                      styleClass="button--full button--yahoo" value="Yahoo"/>
                  </li>
                  <li
                    class="l--push-top-half l--pad-top-half l--pad-h-half bg--pop-higher">
                    <h:outputLabel for="openid">Open ID</h:outputLabel>

                    <div class="g--tighter">
                      <div class="g__item w--3-4 w--3-4-s">
                        <h:inputText id="openid" value="#{loginAction.openId}"/>
                      </div>
                      <div class="g__item w--1-4 w--1-4-s">
                        <h:commandButton
                          action="#{loginAction.openIdLogin('Generic')}"
                          styleClass="button--full" value="Go"/>
                      </div>
                    </div>
                  </li>
                </ul>
              </h:form>
            </s:div>
          </div>
        </div>
      </div>
    </div>
  </ui:define>
</ui:composition>
